package com.wnxy.admin.common.handler;

import lombok.Getter;

@Getter
public enum ChargingPileStateEnum {
    PIE_DEFAULT( "0", "空闲"),
    PIE_RESERVATION("1","预约"),
    PIE_WORKING("2", "充电中")
    ;

    private String code;
    private String discribe;

    ChargingPileStateEnum(String code, String discribe) {
        this.code = code;
        this.discribe = discribe;
    }

    public static String getStatus(String code){
        ChargingPileStateEnum[] values = ChargingPileStateEnum.values();
        for (ChargingPileStateEnum os : values) {
            if (code.equals(os.getCode())){
                return os.getDiscribe();
            }
        }
        return null;
    }
}
